<div class="admin_left actions">
    <h3 style="font-size:20px;">Manage more</h3>
	<ul>
		<li style="list-style-type:none; margin-bottom:20%;"><?php echo $this->Html->link(__('Edit Supplier'), array('action' => 'edit', $supplier['Supplier']['id']),array('class' => 'consistentButton2')); ?> </li>
        <li style="list-style-type:none; margin-bottom:20%;"><?php echo $this->Html->link(__('New Supplier'), array('action' => 'add'),array('class' => 'consistentButton2')); ?> </li>
		<li style="list-style-type:none; margin-bottom:20%;"><?php echo $this->Html->link(__('List Suppliers'), array('action' => 'index'),array('class' => 'consistentButton2')); ?> </li>
	    <li style="list-style-type:none; margin-bottom:20%;"><?php echo $this->Html->link(__('List Consigners'), array('controller' => 'consigners', 'action' => 'index'),array('class' => 'consistentButton2')); ?> </li>
	    <li style="list-style-type:none; margin-bottom:20%;"><?php echo $this->Html->link(__('List Purchases'), array('controller' => 'purchases', 'action' => 'index'),array('class' => 'consistentButton2')); ?> </li>
        <li style="list-style-type:none; margin-bottom:20%;"><?php echo $this->Html->link(__('New Purchase'), array('controller' => 'purchases', 'action' => 'add'),array('class' => 'consistentButton2')); ?> </li>
	</ul>
</div>

<div  id="pinkHeader" class="admin_right suppliers view">

    <div id=breadcrumbAdmin>
            <?php $this->Html->addCrumb('Suppliers', '/Suppliers/index'); ?>
            <?php $this->Html->addCrumb('View', '/Suppliers/view', array('style'=> ('text-decoration:underline;  color:#EB1E70;'))); ?>
            <?php echo $this->Html->getCrumbs(' > ', array( 'text' => 'Transactions', 'url' => array('controller' => 'sales', 'action' => 'index'), 'escape' => false)); ?>
    </div>
    <h2><?php  echo __('Supplier'); ?></h2>
    <table cellpadding="0" cellspacing="0" class=" table table-bordered table-hover">

     		<tr>
     			<th><?php echo __('Id'); ?></th>
     			<th><?php echo __('Company Name'); ?></th>
     			<th><?php echo __('Address'); ?></th>
     			<th><?php echo __('Email'); ?></th>
     			<th><?php echo __('Phone'); ?></th>
     			<th><?php echo __('Status'); ?></th>
     			&nbsp;
     		</tr>

     		<tr>
     			<td>
     				<?php echo h($supplier['Supplier']['id']); ?>
     				&nbsp;
     			</td>

     			<td>
     				<?php echo h($supplier['Supplier']['company_name']); ?>
     				&nbsp;
     			</td>

     			<td>
     				<?php echo h($supplier['Supplier']['address']); ?>
     				&nbsp;
     			</td>

     			<td>
     				<?php echo h($supplier['Supplier']['email']); ?>
     				&nbsp;
     			</td>

     			<td>
                    <?php echo h($supplier['Supplier']['phone']); ?>
                    &nbsp;
                </td>

                <td>
                    <?php echo $this->Html->link($supplier['Status']['name'], array('controller' => 'statuses', 'action' => 'view', $supplier['Status']['id'])); ?>
                    &nbsp;
                </td>
     		</tr>
    </table>

    <div style="border-top:solid 1px; margin-top:10%;" class="related">
        <h3><?php echo __('Related Purchases'); ?></h3>
        <?php if (!empty($supplier['Purchase'])): ?>
        <table cellpadding = "0" cellspacing = "0" class=" table table-bordered table-hover" >
        <tr>
            <th><?php echo __('Id'); ?></th>
            <th><?php echo __('Item Id'); ?></th>
            <th><?php echo __('Supplier Id'); ?></th>
            <th><?php echo __('Price'); ?></th>
            <th><?php echo __('Date'); ?></th>
            <th><?php echo __('Note'); ?></th>
            <th class="actions"><?php echo __('Actions'); ?></th>
        </tr>
        <?php
            $i = 0;
            foreach ($supplier['Purchase'] as $purchase): ?>
            <tr>
                <td><?php echo $purchase['id']; ?></td>
                <td><?php echo $purchase['item_id']; ?></td>
                <td><?php echo $purchase['supplier_id']; ?></td>
                <td><?php echo $purchase['price']; ?></td>
                <td><?php echo $purchase['date']; ?></td>
                <td><?php echo $purchase['note']; ?></td>
                <td class="actions">
                    <?php echo $this->Html->link(__('View'), array('controller' => 'purchases', 'action' => 'view', $purchase['id'])); ?>
                    <?php echo $this->Html->link(__('Edit'), array('controller' => 'purchases', 'action' => 'edit', $purchase['id'])); ?>
                    <?php echo $this->Form->postLink(__('Delete'), array('controller' => 'purchases', 'action' => 'delete', $purchase['id']), null, __('Are you sure you want to delete # %s?', $purchase['id'])); ?>
                </td>
            </tr>
        <?php endforeach; ?>
        </table>
    <?php endif; ?>

    </div>
</div>